home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
util
/
wb
/
BWS_Scalos.lha
/
BWS_Scalos
/
Cascade_plugin
/
cascade.e
next >
Wrap
Text File
|
2001-12-05
|
2KB
|
97 lines
OPT PREPROCESS
LIBRARY 'Cascade.plugin',2,03,'$VER: Cascade.plugin 2.03 (05.12.2001)' IS
cascade(A0,A1)
MODULE 'scalos/scalos','intuition/intuition','intuition/intuitionbase',
'intuition/screens','amigaini','amigainibase'
PROC cascade(wt:PTR TO scawindowtask,inode:PTR TO scaiconnode) HANDLE
DEF w:PTR TO window,x=0,y=15,xi=15,yi=15,
mx,my,ai=0:PTR TO amigaini
/* Check for amigaini lib and load attempt to load settings */
IF (amigainibase:=OpenLibrary(AMIGAINI_NAME,AMIGAINI_VMIN))<>NIL
NEW ai
Ini_Init(ai,'ENV:Scalos/Cascade.ini')
Ini_Read(ai)
IF ai.error=INIE_Ok
IF Ini_FindGroup(ai,'INITIAL')<>-1
x:=Ini_GetInt(ai,'LEFT',0)
y:=Ini_GetInt(ai,'TOP', 15)
ENDIF
IF Ini_FindGroup(ai,'INCREMENT')<>-1
xi:=Ini_GetInt(ai,'MOVE RIGHT',15)
yi:=Ini_GetInt(ai,'MOVE DOWN' ,15)
ENDIF
ENDIF
ENDIF
mx,my:=mxy()
-> get apointer to the passed window structure
w:=wt.window
/* see if multiple windows are open and cycle back to the first one */
IF w.parent THEN WHILE w.parent DO w:=w.parent
/* Now cycle through the window list in the right order */
w:=w.descendant -> wb.window + 1
WHILE w
IF StrLen(w.title)<>0 -> window has title text
stack(w,x,y,mx,my) -> Stack the window
x:=x+xi
y:=y+yi
ENDIF
w:=w.descendant
ENDWHILE
EXCEPT DO
IF ai THEN END ai
IF amigainibase THEN CloseLibrary(amigainibase)
ENDPROC
PROC stack(w:PTR TO window,x,y,mx,my); DEF dx,dy,dw=0,dh=0
dx:=(0-w.leftedge)+x
dy:=(0-w.topedge)+y
IF (w.width+x) > mx
dw:=mx-(w.width+x)
IF w.width+dw < w.minwidth THEN dw:=w.minwidth-w.width
ENDIF
IF (w.height+y) > my
dh:=my-(w.height+y)
IF w.height+dh < w.minheight THEN dh:=w.minheight-w.height
ENDIF
IF (dw) OR (dh) THEN SizeWindow(w,dw,dh)
MoveWindow(w,dx,dy)
WindowToFront(w)
ActivateWindow(w)
ENDPROC
PROC mxy(); DEF ib:PTR TO intuitionbase,x,y
ib:=intuitionbase
Forbid() -> forbid acces while we mess around
-> get screen size
x:=ib.activescreen::screen.width
y:=ib.activescreen::screen.height
Permit()
ENDPROC x,y
PROC main() IS EMPTY